package ext.wxcp;

import me.chanjar.weixin.cp.api.WxCpConfigStorage;
import me.chanjar.weixin.cp.api.WxCpService;
import me.chanjar.weixin.cp.bean.WxCpXmlMessage;
import me.chanjar.weixin.cp.bean.WxCpXmlOutMessage;
import util.extension.InvocationContext;
import models.enums.WxcpAppType;

/**
 * 微信企业号扩展上下文.
 */
public class WxCpContext implements InvocationContext {

    /**
     * 当前的App.
     */
    public WxcpAppType appType;

    public WxCpConfigStorage wxCpConfigStorage;

    public WxCpService wxCpService;

    public WxCpXmlMessage inMessage;

    public WxCpXmlOutMessage outMessage;

    private WxCpContext() {
    }

    public static WxCpContext build(WxcpAppType appType, WxCpConfigStorage wxCpConfigStorage, WxCpService wxCpService, WxCpXmlMessage inMessage) {
        WxCpContext context = new WxCpContext();
        context.appType = appType;
        context.wxCpConfigStorage = wxCpConfigStorage;
        context.wxCpService = wxCpService;
        context.inMessage = inMessage;
        context.outMessage = null;
        return context;
    }
}
